/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.prashant.sqlduniya.dashboard;

import java.util.ArrayList;
import java.util.List;
import javax.swing.AbstractListModel;
import org.prashant.sqlduniya.sqlmanager.TableBean;

/**
 *
 * @author prashant
 */
public class TableNodeListModel extends AbstractListModel {

    private List<TableBean> tables = new ArrayList<TableBean>();

    public TableNodeListModel(List<TableBean> tables) {
        this.tables = tables;
    }

    @Override
    public int getSize() {
        return tables.size();
    }

    @Override
    public Object getElementAt(int index) {
        if(index < tables.size())
            return tables.get(index);
        return null;
    }
}
